
<!-- 配置文件 -->
<script type="text/javascript" src="__PUBLIC__/admin/js/ueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="__PUBLIC__/admin/js/ueditor/ueditor.all.js"></script>
<!-- 实例化编辑器 -->
<script type="text/javascript">
	var ue = UE.getEditor('edit');
</script>


<div class="container" style="padding-top: 50px;">
	<div class="row clearfix">
		<div class="col-md-12 column">
			<form class="form-horizontal" role="form">
				<input type="hidden" id="id" value="{$res.id}" />


				<div class="form-group">
					<label for="inputPassword3" class="col-sm-2 control-label">内容:</label>
					<div class="col-sm-10">
						<textarea id="edit" name="content" type="text/plain">{$res.content}</textarea>
					</div>
				</div>

				<div class="form-group">
					<div class="col-sm-offset-2 col-sm-10">
						<button type="button" class="btn btn-primary button">修改</button>
					</div>
				</div>
			</form>
		</div>
	</div>
	<script>
		$(function() {


			$(".button").click(function() {
				var id = $('#id').val();
				var content = ue.getContent();
				if(content == "") {
					alert('请输入内容');
					return false;
				}
				var url = "{:U('Article/up_upshow')}"
				var parm = {
					id:id,
					content: content,	
				}
				//console.log(parm);
				$.post(url, parm, function(obj) {
					if(obj.s) {
						alert(obj.m);
						location.href = "{:U('Article/up_show')}?id="+id;
					}
				})

			})

		});
	</script>